import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    meta:{
      keepAlive:false,
    },
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue'),
  },
  {
    meta:{
      keepAlive:false,
    },
    path: '/details',
    name: 'Details',
    component: () => import('../views/Details.vue'),
  },
  {
    meta:{
      keepAlive:false,
    },
    path: '/me',
    name: 'Me',
    component: () => import('../views/Me.vue'),
  },
  {
    meta:{
      keepAlive:false,
    },
    path: '/shop',
    name: 'Shop',
    component: () => import('../views/Shop.vue'),
  },
  {
    meta:{
      keepAlive:false,
    },
    redirect:'/apps/listclass',
    path: '/apps',
    name: 'Apps',
    component: () => import('../views/Apps.vue'),
    children:[
      {
        path: 'listclass',
        name: 'ListClass',
        component: () => import('../components/ListClass.vue'),
      },
    ],
  },
  {
    meta:{
      keepAlive:true,
    },
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    redirect:"/home",
    path: '*',
    name: 'Found404',
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
